The online racing simulator
Searching in All forums
(951 results)
Yisc[NL]
S3 licensed
Quote from Scawen :I can't see any reason to consider Steam at this time. It seems to me a really terrible time to just stop developing, hire an accountant, set up a limited company and start integrating LFS with the Steam system. All this while using the old version of LFS which people will just insult because of the outdated graphics.

Please don't try to start explaining why I should stop development right now and dedicate my life to business structures and Steam integration, because I am not remotely interested in that and might as well jump off a cliff. Instead, I am doing what I like to do, currently that is working on a new lighting system.

Keep up the good work.
I am sure the end result will blow everyone away.
Yisc[NL]
S3 licensed
I think that the one thing that makes LFS stand out of many other games, is the perfection that is delivered with every update/patch. Once Scawen decides he wants something, it never will be delivered being done half or broken, but always in the best way possible. Another thing is that he listens to what the community has to say or wants and if that's reasonable then he will try to put it in, again to the highest standard possible.
Yisc[NL]
S3 licensed
Quote from CozmicDragon :Sometimes I wonder if this community actually realizes that LFS is developed by three people, and not a whole studio. The comparisons to the likes of rF2 and Assetto are so unfair it makes me genuinely feel bad for the LFS devs. Those games have entire studios behind them that are pretty much working on those games 24/7. LFS is an indie game developed by three people on their free time, and I think a lot of people fail to grasp that.

LFS isn't updated any quicker because it is humanly impossible for a three-person team to work on a game as extensively as an entire studio of 50+ people. It just doesn't work like that.

Small correction, LFS isn't developed in their free time.
For Scawen and Eric this game is a fulltime job.
Yisc[NL]
S3 licensed
Quote from petercollins :For those of us who paid a lot for S3 content, on the promise that the money would be invested into LFS, now they cannot even be bothered to let us know there is no news.

I paid almost $26 AUD for one track. I paid it because I thought it would kick start some new development in a sim I love.

But it didn't.

Fool me once, shame on you. Fool me twice, shame on me.

There was some sort of progress report in the thread from April.
With LFS it is simple, once you decide to pay for any license, you pay for the product as it is in that moment.
So, there's no need to complain as you already have all you paid for and with a 100% certainty that you will get much more (and for free, see previous line) in the (near) future.
Yisc[NL]
S3 licensed
I would use a scheduled event to do the rotation.
Rotate track at 0,20 and 40 minutes every hour.
Yisc[NL]
S3 licensed
Changelog for Set Schedule V2.07:

-Added a confirmation window when deleting a single race
-Added a confirmation window when deleting the whole schedule of a server
-Renamed $car_names to $car_names_set_schedule
-Renamed $car_groups to $car_groups_set_schedule

Change the extension of the file to .lpr and add them to addonsused.lpr to be able to use it.
Yisc[NL]
S3 licensed
Quote from three_jump :It is kinda funny to see how this "little experiment" about setting time of day has slowly turned into a "well, might as well upgrade the whole thing while I'm at it" project. Omg omg omg

This is what makes Scawen different (and stand out) from regular developers.
He doesn't like doing in a half baked but it will still work kind of way, but is always aiming for perfection.
People looking at this in a negative way, will say that it's slowing things down, etc. etc. while those that are liking a journey like this, are fully enjoying the ride and are patiently waiting for the outcome of all of this.
Keep it up Scawen, I for one, really like this journey.
Yisc[NL]
S3 licensed
I have just read ConvWr.bat again and in the comment it says this:

coef = multiple coef possibility separated by ':'
rem ex : 100.5
rem : 100.5:101:101.5

So for multiple coefficients the line should look like this:

ConvWr.exe -i [pubstat ID] -o trackInfo.cfg -c 100.5:101:102 -mlc 200
Yisc[NL]
S3 licensed
I don't think that the script can produce an extra timing, but I also think that you already have what you need.

When you separate this value "0.44.60:0.45.27:0.45.94" by using : as a separator, you are left with 3 values:

0.44.60
0.45.27
0.45.94

A time below 0.45.94 will qualify it as "Good"
If the time is also below 0.45.27, it will qualify it as "Great"
If the time is also below 0.44.60, it will qualify it as "Awesome"

You can always try to debug this by setting some easy to get values and then drive to split1 and see what happens
Yisc[NL]
S3 licensed
1) Download the zip file attached to this message
2) Unzip the file to any directory
3) Open file 'ConvWr.bat' with any editor
4) Replace "[pubstat ID]" by your own pubstat ID
5) Save the file
6) Double click 'ConvWr.bat' to run the file
7) When it says "Done!" , press a key to end the batchfile
8) In the same folder where you have the batchfile, you will now find a file named 'trackInfo.cfg'
9) Copy/Paste that file into your Lapper directory
Yisc[NL]
S3 licensed
You can read their IP address, convert that to a country and block them if country isn't the one you want to allow. You have to remember though that getting another IP address from an allowed country, isn't that hard these days, so it will never be a bullet proof system.
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Guys does anyone had the EditPlus Syntax Highlighting file please.

Andy

I fired up my old computer and grabbed the files.
With the help of this, I activated them in EditPlus: https://www.lfs.net/forum/post/1928057#post1928057

Credits to TechEdison for creating those files back in the day.
Yisc[NL]
S3 licensed
Quote from Andy King :Hi, is it possible to use Reload() to restart Lapper on another one of my servers I'm not on without closing console totally. If I edit a script while on server 2 and want to reload lapper on server 4 or all of my servers?

Can anyone tell me what the Function of setlicense() is please as can't find any info on it?

Andy

The reload command is always executed for all instanced of Lapper that are running at that moment.
If you want to stop/start a single instance, you need to do that using the lapper console, with a command like this: stop 15-AB-TST
Followed by: start 15-AB-TST

To see which instances of Lapper are running, type this in the Lapper console: list
Yisc[NL]
S3 licensed
That is the latest version and certainly has that function.
Could you send me the script or maybe your whole Lapper directory?
Yisc[NL]
S3 licensed
What version of Lapper are you running?
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Guys, can someone help me with how to add u username to a text.txt file with each added on a separate line as tried for hours with no joy.

Andy

You can do that with this:

### Create a text file on the desktop for debugging purposes ###
$FileName = "Filename";
$NameofDirectory = "C:\Users\Sjoerd\Desktop";
$FileExistOption = 1;
CreateFile($FileName,$NameofDirectory,$FileExistOption);
### End ###

And this:

### Write results to created text file, for debugging purposes ###
$Filename = "Filename";
$Folder = "C:\Users\Sjoerd\Desktop";
$NewText = "key = " . $licence_name . " | userName = " . $list[$j,"UserName"] . " | strval = " . $licence_type . "" );
$LineToEdit = -1; # -1 to create a extra line
$Extension = ".txt";
EditFile($Filename,$Folder,$NewText,$LineToEdit,$Extension);
### End ###

The first piece of code could go in a start-event of Lapper, while the other part can go where ever you want it.
You do have to think about the fact that you might not want to have everyone's names in there multiple times (like, adding the name to the file on every connect), but it will depend on your purpose with such file.
Yisc[NL]
S3 licensed
Quote from Andy King :Hi Guys, found another thing that won't work and cannot see whats wrong with it...

cmdLFS("/msg ^7ADMIN: " . GetPlayerVar($argv, "NickName") . " ^6READ MESSAGE BELOW...");

Andy

What kind of error do you get?
What happens before this command is executed?
Try to debug every step along the way, like:

- does the script reach the place where cmdLFS should be executed
- does $argv have a value
- if $argv has a value, does this give a value: GetPlayerVar($argv, "NickName")

Being able to write code is one of the skills needed to build scripts, but being able to debug your code is as equally important.

All of this said with respect and trying to educate you and/or other viewers.
Yisc[NL]
S3 licensed
Let me give you a very value tip then (well, I think it is), you can use one variable and store a lot of information into it, as long as you have a separator to split the information.
See screenshot below, as an example what I did with all Pitboard settings.
Yisc[NL]
S3 licensed
There is no reason why SetUserStoredValue should not work when a player is not online.
After all, the only thing Lapper does, is adjusting values in a database, and therefor the players aren't needed.
I quickly extended my script, and as far as I can tell (I looked live into my database) this is working as intended:


CatchEvent OnLapperStart()
OnLapperStart_Register_ID();
EndCatchEvent

CatchEvent OnMSO( $userName, $text ) # Player event
$idxOfFirtsSpace = indexOf( $text, " ");

$userName = GetCurrentPlayerVar("UserName");

UserGroupFromFile( "admin", "./../AB-Configs/admin.txt" );

IF( $idxOfFirtsSpace == -1 ) THEN
$command = $text;
$argv = "";
ELSE
$command = subStr( $text,0,$idxOfFirtsSpace );
$argv = trim( subStr( $text,$idxOfFirtsSpace ) );
ENDIF

SWITCH( $command )
CASE "!pay_divident":
CASE "!pd":

IF( UserInGroup( "admin", $userName ) == 1 )
THEN
Pay_divident( $KeyFlags );
ELSE
PrivMsg( "^1You are not allowed to do that");
ENDIF
BREAK;
ENDSWITCH
EndCatchEvent

CatchEvent OnConnect( $userName )
OnConnect_Register_ID();
EndCatchEvent

Sub OnLapperStart_Register_ID()
### Declare global variables ###
GlobalVar $register_counter;
### End ###

### Load stored values and give them a default setting if no stored value has been found ###
$register_counter = GetStoredValue( "REGISTER_COUNTER" );

IF ($register_counter == "")
THEN
$register_counter=0;
ELSE
$register_counter = ToNum( GetStoredValue( "REGISTER_COUNTER" ) );
ENDIF
### End ###
EndSub

Sub OnConnect_Register_ID()
### Retrieve the username ###
$userName = GetCurrentPlayerVar( "UserName");
### End ###

### Set $user_found to 'no' ###
$user_found = "no";
### End ###

### Check if $userName is NOT empty ###
IF ( $userName != "" )
THEN
### Loop through already registered user accounts, looking for the current username ###
FOR ( $i = 0; $i < $register_counter; $i = $i + 1 )
IF ( GetStoredValue( "UserName_Number_" . $i ) == $userName )
THEN
GlobalMsg( "User already registered on system" );
GlobalMsg( "^7User ID: ^6" . $i );
writeline( "User already registered on system" );
$user_found = "yes";
BREAK;
ENDIF
ENDFOR
### End ###

### If username hasn't been found in registered users, register this user, raise $register_counter by 1 and write new value for REGISTER_COUNTER to the database ###
IF ( $user_found == "no" )
THEN
SetStoredValue( "UserName_Number_" . ToString( $register_counter ) , $userName );
SetUserStoredValue( $userName , "Cash" , 0 );

$register_counter = $register_counter+1;
SetStoredValue( "REGISTER_COUNTER" , $register_counter );

GlobalMsg( "^7New User (^6" . $userName . "^7) has been registered." );
GlobalMsg( "^7New User ID: ^6" . ToNum( $register_counter ) );
writeline( "^7New User (^6" . $userName . "^7) has been registered." );
ENDIF
### End ###
ENDIF
### End ###
EndSub

Sub Pay_divident( $KeyFlags )
$Divident = 50;

### Loop through already registered user accounts, looking for the current username ###
FOR ( $i = 0; $i < $register_counter; $i = $i + 1 )
$IDUser = GetStoredValue( "UserName_Number_" . $i );
$cash = GetUserStoredValue( $IDUser, "Cash" );
$new_cash = ToNum ( Round( $cash + $Divident,2 ) );

writeline( "attempting to give user " . $IDUser . " cash from " . GetUserStoredValue( $IDUser, "Cash" ) );

SetUserStoredValue( $IDUser , "Cash", $new_cash );

writeline( "attempted to give user " . $IDUser . " cash to " . GetUserStoredValue( $IDUser, "Cash" ) );
ENDFOR
### End ###
EndSub

Yisc[NL]
S3 licensed
This is working like it should:


CatchEvent OnLapperStart()
OnLapperStart_Register_ID();
EndCatchEvent

CatchEvent OnConnect( $userName )
OnConnect_Register_ID();
EndCatchEvent

Sub OnLapperStart_Register_ID()
### Declare global variables ###
GlobalVar $register_counter;
### End ###

### Load stored values and give them a default setting if no stored value has been found ###
$register_counter = GetStoredValue( "REGISTER_COUNTER" );

IF ($register_counter == "")
THEN
$register_counter=0;
ELSE
$register_counter = ToNum( GetStoredValue( "REGISTER_COUNTER" ) );
ENDIF
### End ###
EndSub

Sub OnConnect_Register_ID()
### Retrieve the username ###
$userName = GetCurrentPlayerVar( "UserName");
### End ###

### Set $user_found to 'no' ###
$user_found = "no";
### End ###

### Check if $userName is NOT empty ###
IF ( $userName != "" )
THEN
### Loop through already registered user accounts, looking for the current username ###
FOR ( $i = 0; $i < $register_counter; $i = $i + 1 )
IF ( GetStoredValue( "UserName_Number_" . $i ) == $userName )
THEN
GlobalMsg( "User already registered on system" );
GlobalMsg( "^7User ID: ^6" . $i );
writeline( "User already registered on system" );
$user_found = "yes";
BREAK;
ENDIF
ENDFOR
### End ###

### If username hasn't been found in registered users, register this user, raise $register_counter by 1 and write new value for REGISTER_COUNTER to the database ###
IF ( $user_found == "no" )
THEN
SetStoredValue( "UserName_Number_" . ToString( $register_counter ) , $userName );
$register_counter = $register_counter+1;
SetStoredValue( "REGISTER_COUNTER" , $register_counter );

GlobalMsg( "^7New User (^6" . $userName . "^7) has been registered." );
GlobalMsg( "^7New User ID: ^6" . ToNum( $register_counter ) );
writeline( "^7New User (^6" . $userName . "^7) has been registered." );
ENDIF
### End ###
ENDIF
### End ###
EndSub

Yisc[NL]
S3 licensed
First of all I don't understand why you would start a counter with value 2, but maybe you have a good reason for that.
Then you have this: ToString(GetPlayerVar( $userName , "UserName" ))

Where does $userName come from?
As I do not see that anywhere in this piece of script.
Would it be possible to put up the whole script here?
Otherwise feel free to send me a PB with the whole script or to ask for my email to send it there.
Yisc[NL]
S3 licensed
I have created the following file:


CatchEvent OnLapperStart()
OnLapperStart_PB();
EndCatchEvent

CatchEvent OnPB( $userName )
OnPB_announce();
EndCatchEvent

Sub OnLapperStart_PB()
### Declare global variable(s) ###
GlobalVar $AS3_E;
### End ###

### Give global variable(s) a value to start with ###
$AS3_E = MSHToNum("1.48.00");
### End ###

writeline ( "DEBUG1: " . $AS3_E );
EndSub

Sub OnPB_announce()
writeline ( "DEBUG2: " . GetCurrentPlayerVar( "LapTime" ) );
writeline ( "DEBUG3: " . NumToMSH( $AS3_E ) );

IF ( NumToMSH( GetCurrentPlayerVar( "LapTime" ) ) <= NumToMSH( $AS3_E ) )
THEN
cmdLFS("/msg ^7New PB by " . GetCurrentPlayerVar("NickName") . "^7 (" . GetCurrentPlayerVar("Car") . ") - " . NumToMSH(GetCurrentPlayerVar("LapTime")));
ENDIF
EndSub

When Lapper is (re)started, this is shown on the console: DEBUG1: 108000
When I drive a PB, this is shown on the console:

DEBUG2: 106080
DEBUG3: 1.48.00

I don't understand why you convert the globalvar from MSHToNum (value shown in DEBUG1) and then convert it from NumToMSH (value shown in DEBUG3) when you are comparing it with the laptime driven (value shown in DEBUG2) that is also converted to NumToMSH.

Most important lesson in this, is to check what value is returned by Lapper (like I did with adding these DEBUG lines) and only convert them if really needed.

The correct script should be like this in my opinion:


CatchEvent OnLapperStart()
OnLapperStart_PB();
EndCatchEvent

CatchEvent OnPB( $userName )
OnPB_announce();
EndCatchEvent

Sub OnLapperStart_PB()
### Declare global variable(s) ###
GlobalVar $AS3_E;
### End ###

### Give global variable(s) a value to start with ###
$AS3_E = "1.48.00";
### End ###

writeline ( "DEBUG1: " . $AS3_E );
EndSub

Sub OnPB_announce()
writeline ( "DEBUG2: " . GetCurrentPlayerVar( "LapTime" ) );
writeline ( "DEBUG3: " . MSHToNum( $AS3_E ) );

IF ( GetCurrentPlayerVar( "LapTime" ) <= MSHToNum( $AS3_E ) )
THEN
cmdLFS( "/msg ^7New PB by " . GetCurrentPlayerVar("NickName") . "^7 (" . GetCurrentPlayerVar("Car") . ") - " . NumToMSH(GetCurrentPlayerVar("LapTime")));
ENDIF
EndSub

Yisc[NL]
S3 licensed
The answer to this "Is there a way to retrieve all usernames of players in storedvalue.dbs so I can #do something# with their stored data?" is no, you cannot do such thing by default.

If you want to do that, you need a storedvalue that has a fixed name and is raised every time by a number like "money_wallet_1" , "money_wallet_2" etc, while you also have a stored_value that keeps track of the latest number that has been used.
Those two combined, gives you the opportunity to retrieve all the values and do something with it.
I used a similar construction when I build by Register system.
Yisc[NL]
S3 licensed
You cannot use multiple arguments, but a way to work around that is to use a separating sign like | and then split the $argv into two values using SplitToArray

So if you would type: !admin yisc[nl]|0

Then use this to split the values: $splitted_values = SplitToArray ( $argv , "|" );

Then use this to store them: SetUserStoredValue( $splitted_values[0], "Admin", $splitted_values[1] );

Make sure that the splitting value isn't commonly used in usernames, otherwise bad things might happen.
But you can use nearly anything to separate and split them, so should be okay.
Yisc[NL]
S3 licensed
Quote from Andy King :Thanks Yisc, still struggling. I'm trying to add a Users Admin Status to database so I can have BETA Testers testing PitBoard but can't work it out how to set a Users Details...

SetUserStoredValue($argv."Admin","0"); (That sets me only)

I know thats wrong but where do I put the $argv to set a UserName? So I type !Level UserName which sets Users Stored Value to Admin 0 meaning I can manually add testers.

Thanks in Advance
Andy

The syntax you have used for SetUserStoredValue is wrong.
Should be like this: SetUserStoredValue( $argv, "Admin", 0 );

So, no dot after $argv but a comma.
Also a number should not be between quotes, as that would mean it would be stored as text instead of a numeric value.
FGED GREDG RDFGDR GSFDG